package cn.cmvideo.xworld.broadcastreceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import cn.cmvideo.xworld.util.HttpUtils;

public class ConnectionChangeReceiver extends BroadcastReceiver {
	@Override
	public void onReceive(Context context, Intent intent) {
		String tip = null;
		if (HttpUtils.getAPNType(context) == HttpUtils.NO_NETWORK) {
			tip = "网络无连接";
		} else if (HttpUtils.getAPNType(context) == HttpUtils.WIFI) {
			tip = "当前网络为WIFI";
		} else if (HttpUtils.getAPNType(context) == HttpUtils.WAP) {
			tip = "当前网络为CMWAP";
		} else {
			tip = "当前网络为CMNET";
		}
		Toast.makeText(context, tip, Toast.LENGTH_SHORT).show();
	}
}